package com.atustcchen.javaailongchain4j.service.impl;

import com.atustcchen.javaailongchain4j.Entity.Appointment;
import com.atustcchen.javaailongchain4j.Mapper.AppointmentMapper;
import com.atustcchen.javaailongchain4j.service.AppointmentService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

@Service
public class AppointmentServiceImpl extends ServiceImpl<AppointmentMapper, Appointment> implements AppointmentService  {
    @Override
    public Appointment getOne(Appointment appointment) {
        LambdaQueryWrapper<Appointment> queryWrapper = new LambdaQueryWrapper<Appointment>();
        queryWrapper.eq(Appointment::getDepartment, appointment.getDepartment());
        queryWrapper.eq(Appointment::getId_card, appointment.getId_card());
        queryWrapper.eq(Appointment::getTime, appointment.getTime());
        queryWrapper.eq(Appointment::getUsername, appointment.getUsername());
        queryWrapper.eq(Appointment::getDate, appointment.getDate());
        Appointment ans=baseMapper.selectOne(queryWrapper);
        return ans;
    }
}
